package com.briup.jdbcSQL;

import java.util.List;

import com.briup.jdbc.extannotation.ExtDelete;
import com.briup.jdbc.extannotation.ExtInsert;
import com.briup.jdbc.extannotation.ExtParam;
import com.briup.jdbc.extannotation.ExtSelect;
import com.briup.jdbc.extannotation.ExtUpdate;
import com.briup.pojo.Emp;

public interface SelectTest {

	@ExtSelect("select id,last_name,first_name,userid,start_date,comments,manager_id,title,dept_id,salary,commission_pct from s_emp")
	List<Emp> select();

	@ExtSelect("select id,last_name,first_name,userid,start_date,comments,manager_id,title,dept_id,salary,commission_pct from s_emp where id=#{id}")
	List<Emp> selectById(@ExtParam("id") int id);

	@ExtUpdate("update s_emp set salary = #{emp.salary} where id = #{emp.id}")
	int updateSalaryById(@ExtParam("emp") Emp emp);

	@ExtUpdate("update s_emp set salary = #{salary} where id = #{id}")
	int updateSalaryByIdAndSalary(@ExtParam("id") int id, @ExtParam("salary") int salary);

	@ExtUpdate("update s_emp set salary = #{salary} ")
	int updateSalaryAllSalary(@ExtParam("salary") int salary);

	@ExtDelete("delete from s_emp where id = #{id}")
	int deleteEmpById(@ExtParam("id") int id);

	@ExtDelete("delete from s_emp where id > 1999")
	int deleteBys1999s();

	@ExtInsert("insert into s_emp(id,last_name) values(#{id},#{last_name})")
	int insertEmp(Emp emp);

	@ExtInsert("insert into s_emp(id,last_name) values(#{id},#{last_name})")
	int insertEmps(List<Emp> emps);
}
